<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Shoppinghere</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Mạng xã hội mua bán siêu việt | ShoppingHere.com</title>
		<link rel="stylesheet" href="css/reset.css" type="text/css" />
		<link rel="stylesheet" href="css/common.css" type="text/css" />
		<link rel="stylesheet" href="css/home.css" type="text/css" />
		<script src="scripts/jquery-1.5.2.min.js"></script>
		<script src="scripts/common.js"></script>
        <style type="text/css" >
			.sao
			{
				font-size:16px;
				color:#FFCC00;
			}
		</style>
        <script type="text/javascript" language="javascript">
			var xmlhttp;
			function CreateHTTPRequest()
			{
				if(window.XMLHttpRequest)
				{
					return new XMLHttpRequest();
				}
				else if(window.ActiveXOject)
				{
					return new ActiveXOject("Microsoft.XMLHTTP");
				}
			}
			
			function btnTimKiem()
			{
				var ten=document.getElementById("txtTenSP").value;
				var giamin=document.getElementById("txtGiaF").value;
				var giamax=document.getElementById("txtGiaTo").value;
				var saomin=document.getElementById("txtSao1").value;
				var saomax=document.getElementById("txtSao2").value;
				if(ten=="")
				{
					alert("Chưa nhập tên sản phẩm muốn tìm");
					return;
				}
				if(saomin>saomax)
				{
					return;
				}
				
				xmlhttp=CreateHTTPRequest();
				var serverUrl="DAO/TimNangCao_DAO.php?ten="+ten+"&min="+giamin+"&max="+giamax+"&saomin="+saomin+"&saomax="+saomax;
				xmlhttp.onreadystatechange=ShowAdvanceSearch;
				xmlhttp.open("get",serverUrl,true);
				xmlhttp.send(null);
			}
			function ShowAdvanceSearch()
			{
				if(xmlhttp.readyState==4 && xmlhttp.status==200)
				{
					var div=document.getElementById("divresult");
					var result=xmlhttp.responseText;
					div.innerHTML=result;
				}
			}
			
			function indexClick(i)
			{
				var str=document.getElementById("keyhd").value;
				var type=document.getElementById("typehd").value;
				xmlhttp=CreateHTTPRequest();
				var serverUrl="DAO/TimNangCao_DAO.php?"+str+"&type="+type+"&page="+i;
				xmlhttp.onreadystatechange=ShowAdvanceSearch;
				xmlhttp.open("get",serverUrl,true);
				xmlhttp.send(null);
			}
			
			function cbChange()
			{
				var str=document.getElementById("keyhd").value;
				var type=document.getElementById("slid").value;
				xmlhttp=CreateHTTPRequest();
				var serverUrl="DAO/TimNangCao_DAO.php?"+str+"&type="+type;
				xmlhttp.onreadystatechange=ShowAdvanceSearch;
				xmlhttp.open("get",serverUrl,true);
				xmlhttp.send(null);
			}
        </script>
	</head>
	<body>
		<div id="page">
			<?php
			include_once("webconfig.php");
			include_once("DAO/DataHelper.php");
			include_once("DAO/DanhMucSanPham_DAO.php");
			include_once("DAO/SanPham_DAO.php");
            require("UserControl/header1.php");
			?>
			<div id="content">
			<?php
				require("UserControl/DanhMucLoaiSanPham.php");
			?>
				<div id="hot-seller" class="block layout-3col-col2">
					<div class="title"><h4>Tìm nâng cao</h4></div>
					<div class="content">
						<table>
                        	<tr>
                            	<td align="left">
                                	<label class="titles">Tên sản phẩm</label>
                                </td>
                                <td align="left">
                                	<input type="text" id="txtTenSP" width="500px" class="textboxs" />
                                    <br />
                                </td>
                            </tr>
                             <tr>
                            	<td align="left" colspan="2">
                                	<label class="titles">Được đánh giá từ:</label>
                                    <select id="txtSao1" class="sao">
                                    	<option value="0">0</option>
                                        <option value="1">*</option>
                                        <option value="2">* *</option>
                                        <option value="3">* * *</option>
                                        <option value="4">* * * *</option>
                                        <option value="5">* * * * *</option>
                                    </select>
                                   <label class="titles"> Đến:</label>
                                     <select id="txtSao2" class="sao">
                                    	<option value="0">0</option>
                                        <option value="1">*</option>
                                        <option value="2">**</option>
                                        <option value="3">***</option>
                                        <option value="4">****</option>
                                        <option value="5">*****</option>
                                    </select>
                                </td>
                                                               
                            </tr>
                            <tr>
                            	<td colspan="2" align="left">
                                	<label class="titles">Giá từ :</label>
                                    <input type="text" id="txtGiaF" class="textboxs" /> VND
                                    <label class="titles"> Đến :</label>
                                    <input type="text" id="txtGiaTo" class="textboxs" /> VND
                                    <br />
                                </td>
                                
                            </tr>
                            <tr>
                            	<td colspan="2" align="center">
                                	<input type="button" id="btnTimKiem" value="Tìm" onclick="btnTimKiem();" />
                                </td>
                            </tr>
                        </table>
                        
                        <div id="divresult" align="center">
                        </div>
					</div>
				</div>
				<?php
					require("UserControl/DanhSachSanPhamBanChay.php");	
				?>
			</div>
			<?php
				require("UserControl/footer.php");
			?>
		</div>
	</body>
</html>